class DispatchFormModel extends Backbone.Model
    url: '/mytable/getModel?s=table.creators.DispatchTable'
    initialize: (options) =>
        @fetch()
   
#--------------------------------------------------controler
class DispatchsApp
    search: =>
        myapp.mainRegion.close() 
        mymodel = new DispatchFormModel
        @layout = new ModelMainLayout(model: mymodel)
        myapp.mainRegion.show(@layout)

            

#--------------------------------------------------router
class DispatchsAppRouter extends Backbone.Marionette.AppRouter
    appRoutes: 
        "dispatchs": "search"

                
myapp.addInitializer -> 
    myapp.Dispatchs_app = new DispatchsApp()
    myapp.Dispatchs_app.router = new DispatchsAppRouter controller: myapp.Dispatchs_app

myapp.vent.trigger("routing:started")
